﻿<div class="blade-content __medium-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <form name="detailForm" class="form">
                <div ng-init="setForm(detailForm)">
                    <label class="form-label">SKU</label>
                    <div class="form-input">
                        <input ng-class="{'error': detailForm.code.$invalid && !detailForm.code.$pristine}" required class="form-control" ng-model="blade.item.code" name="code" placeholder="Enter item sku" ui-validate=" 'codeValidator($value)' " />
                    </div>
                    <div class="form-error" data-ng-show="detailForm.code.$dirty">
                        <span data-ng-show="detailForm.code.$error.validator">SKU can't contain $+;=%{}[]|\/@ ~#!^*&()?:'<>, characters</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">Name</label>
                    <div class="form-input">
                        <textarea class="__small" ng-class="{'error': detailForm.itemName.$invalid && !detailForm.itemName.$pristine}" cols="30" rows="2" ng-model="blade.item.name" name="itemName" placeholder="Enter item name"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="columns clearfix">
                        <div class="column">
                            <div class="form-group">
                                <div class="form-control __checkbox">
                                    <label class="form-label">
                                        <input type="checkbox" ng-model="blade.item.isBuyable">
                                        <span class="check"></span>
                                        <span class="name">Can be purchased</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="column">
                            <div class="form-group">
                                <div class="form-control __checkbox">
                                    <label class="form-label">
                                        <input type="checkbox" ng-model="blade.item.isActive">
                                        <span class="check"></span>
                                        <span class="name">Store visible</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="column" ng-if="blade.item.productType!=='Digital'">
                            <div class="form-group">
                                <div class="form-control __checkbox">
                                    <label class="form-label">
                                        <input type="checkbox" ng-model="blade.item.trackInventory">
                                        <span class="check"></span>
                                        <span class="name">Track inventory</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="column" ng-if="blade.item.productType=='Digital'">
                            <div class="form-group">
                                <div class="form-control __checkbox">
                                    <label class="form-label">
                                        <input type="checkbox" ng-model="blade.item.hasUserAgreement">
                                        <span class="check"></span>
                                        <span class="name">Has user agreement</span>
                                    </label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group" ng-if="blade.item.productType!=='Digital'">
                    <div class="columns clearfix">
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Min. quantity</label>
                                <div class="form-input __number">
                                    <input smart-float num-type="integer" ng-model="blade.item.minQuantity">
                                </div>
                            </div>
                        </div>
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Max. quantity</label>
                                <div class="form-input __number">
                                    <input smart-float num-type="integer" ng-model="blade.item.maxQuantity">
                                </div>
                            </div>
                        </div>
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Tax type <a href="" ng-click="openDictionarySettingManagement()" va-permission="platform:setting:update"><i class="form-ico fa fa-pencil"></i></a></label>
                                <div class="form-input">
                                    <ui-select ng-model="blade.item.taxType">
                                        <ui-select-match allow-clear="true" placeholder="Select...">{{$select.selected}}</ui-select-match>
                                        <ui-select-choices repeat="x in taxTypes | filter: $select.search">
                                            <span ng-bind-html="x | highlight: $select.search"></span>
                                        </ui-select-choices>
                                    </ui-select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group" ng-if="blade.item.productType==='Digital'">
                    <div class="columns clearfix">
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Max. number of downloads</label>
                                <div class="form-input __number">
                                    <input smart-float num-type="integer" ng-model="blade.item.maxNumberOfDownload">
                                </div>
                            </div>
                        </div>
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Download expiration date</label>
                                <div class="form-input __calendar">
                                    <input placeholder="Choose date" ng-model="blade.item.downloadExpiration" datepicker-popup="shortDate" is-open="datepickers.str" close-text="Close" />
                                    <button class="btn" type="button" ng-click="open($event,'str')">
                                        <i class="btn-ico fa fa-calendar"></i>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group" ng-if="blade.item.productType==='Digital'">
                    <div class="columns clearfix">
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Download type</label>
                                <div class="form-input">
                                    <ui-select ng-model="blade.item.downloadType" ng-init="downloadTypes=['Standard Product', 'Software', 'Music']">
                                        <ui-select-match placeholder="Select...">{{$select.selected}}</ui-select-match>
                                        <ui-select-choices repeat="x in downloadTypes | filter: $select.search">
                                            <span ng-bind-html="x | highlight: $select.search"></span>
                                        </ui-select-choices>
                                    </ui-select>
                                </div>
                            </div>
                        </div>
                        <div class="column">
                            <div class="form-group">
                                <label class="form-label">Tax type <a href="" ng-click="openDictionarySettingManagement()" va-permission="platform:setting:update"><i class="form-ico fa fa-pencil"></i></a></label>
                                <div class="form-input">
                                    <ui-select ng-model="blade.item.taxType">
                                        <ui-select-match allow-clear="true" placeholder="Select...">{{$select.selected}}</ui-select-match>
                                        <ui-select-choices repeat="x in taxTypes | filter: $select.search">
                                            <span ng-bind-html="x | highlight: $select.search"></span>
                                        </ui-select-choices>
                                    </ui-select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>

            <va-widget-container group="itemDetail" blade="blade" gridster-opts="{width: 526}"></va-widget-container>
        </div>
    </div>
</div>